namespace NPD_FUNC_MIGHT {
	namespace bad {
	
		void xstrcpy(char* dst, char* src) {
			if (!src) return;
			dst[0] = src[0];
		}

		char global;

		char* xmalloc() {
			if (global) return &global;
			return 0;
		}

		void npd_func_might(int flag, char* arg) {
			char* p = arg;
			if (flag) p = xmalloc(); // xmalloc() may return NULL
			if (arg) { p = arg; } // p may get a new value here
			xstrcpy(p, (char*)"Hello"); // p will be dereferenced in xstrcpy()
		}
	
	}
	
	namespace good {
		void xstrcpy(char* dst, char* src) {
			if (!src) return;
			if (!dst) return;
			dst[0] = src[0];
		}

		char global;

		char* xmalloc() {
			if (global) return &global;
			return 0;
		}

		void npd_func_might(int flag, char* arg) {
			char* p = arg;
			if (flag) p = xmalloc(); // xmalloc() may return NULL
			if (arg) { p = arg; } // p may get a new value here
			xstrcpy(p, (char*)"Hello"); // p will be dereferenced in xstrcpy()
		}
	}
}